<?php
$this->beginBlock('toolbar');
$t = $this->toolbar();
echo $t->renderBegin();
echo $t->renderItem($this->link($this->__('system.button.back'), $this->historyUrl('*/*/*/index')));
echo $t->renderEnd();

$this->nextBlock('form');
$f = $this->form()->setId('form');
if($this->model):
	$f->setData($this->model->getAllData());
endif;

echo $f->renderBegin();
?>
<ul id="sortable">
<?php foreach($this->list as $menu): ?>
<li class="ui-state-default">
<?php echo $this->__($menu['name']) ?>
<input type="hidden" name="ids[]" value="<?php echo $menu['id']?>"/>
</li>
<?php endforeach; ?>
</ul>
<?php
echo $f->renderEnd();

$t2 = $this->toolbar();
echo $t2->renderBegin();
echo $t2->renderItem($this->linkButton($this->__('system.button.save'), "submitForm('form')"));
echo $t2->renderEnd();
?>
<script language="javascript">
$(function() {
    $( "#sortable" ).sortable({
        placeholder: "ui-state-highlight"
    });
    $( "#sortable" ).disableSelection();
});
</script>
<?php
$this->endBlock();
echo $this->extend('template'.DS.'form');